package com.hudson.plugin.result.collector.server.datastore.dao;

import com.hudson.plugin.result.collector.server.datastore.dao.exceptions.NonexistentEntityException;
import com.hudson.plugin.result.collector.server.datastore.dao.exceptions.PreexistingEntityException;
import com.hudson.plugin.result.collector.server.datastore.internal.entity.ViewsEntity;

import javax.persistence.EntityManager;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Richard
 * Date: 5/8/11
 * Time: 9:43 PM
 * To change this template use File | Settings | File Templates.
 */
public interface ViewsEntityJpaController {
    EntityManager getEntityManager();

    void create(ViewsEntity viewsEntity) throws PreexistingEntityException, Exception;

    void edit(ViewsEntity viewsEntity) throws NonexistentEntityException, Exception;

    void destroy(int id) throws NonexistentEntityException;

    ViewsEntity findViewsEntity(int id);

    List<Integer> findViewsEntityByModuleAndIcafeProject(String moduleName, String icafeProjectName);

    List<ViewsEntity> findViewsEntityEntities();

    List<ViewsEntity> findViewsEntityEntitiesWithInterval(boolean isAverage, int resultsInterval, int firstResult);

    List<ViewsEntity> findViewsEntityEntities(int maxResults, int firstResult);

    int getViewsEntityCount();
}
